package com.ipan.builder.util;

import java.util.ArrayList;
import java.util.List;


/**
 * 堆栈
 * 
 * @author iPan
 * @version 2013-11-30
 */
public class CompoundRoot extends ArrayList<Object> {

	private static final long serialVersionUID = -6118822812726017291L;

	public CompoundRoot() {
    }

    public CompoundRoot(List<?> list) {
        super(list);
    }


    public CompoundRoot cutStack(int index) {
        return new CompoundRoot(subList(index, size()));
    }

    public Object peek() {
        return get(0);
    }

    public Object pop() {
        return remove(0);
    }

    public void push(Object o) {
        add(0, o);
    }
}

